#!/bin/bash
count=0
for((i=1;i<1001;i++))
do
    num=$i
    while [ $num -gt 0 ]
    do
        sum=`expr $num % 10`
        if [ $sum -eq 5 ]; then
            ((count++))
        fi
        num=`expr $num / 10`
    done
done
echo "$count"

